package demo;

import java.util.Arrays;
import java.util.Scanner;

public class AtestCode {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        String ym[] = s.split(" ");
        String year = ym[0];
        String month = ym[1];
        //判断字符串是不是整数
        if(year.matches("[0-9]+") && month.matches("[0-9]+")){
            switch(month){
                case "1":
                case "3":
                case "5":
                case "7":
                case "8":
                case "10":
                case "12":
                    System.out.println("31 days");
                    break;
                case "4":
                case "6":
                case "9":
                case "11":
                    System.out.println("30 days");
                    break;
                case "2":
                    int y = Integer.parseInt(year);
                    if((y%4==0 && y%100!=0)||y%400==0){
                        System.out.println("29 days");
                    }else {
                        System.out.println("28 days");
                    }
            }
        }else{
            System.out.println("输入的年份或月份错误");
        }
    }
}
